﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="GU.WebERPApp.Index" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="/Scripts/mini.boot.js" type="text/javascript"></script>
    <style type="text/css">
        body{
            margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
        }
    </style> 
</head>
<body>
    <div id="layout1" class="mini-layout" style="width: 100%; height: 100%;">
        <div class="header" region="north" height="70" showsplit="false" showheader="false">
            <h1 style="margin: 0; padding: 15px; cursor: default; font-family: 微软雅黑,黑体,宋体;">
                易果IT管理系统</h1>
            <div style="position: absolute; top: 18px; right: 10px;">
                <a class="mini-button mini-button-iconTop" iconcls="icon-edit" onclick="onClick" plain="true">首页</a> 
                <a class="mini-button mini-button-iconTop" iconcls="icon-date" onclick="onClick" plain="true">消息</a> 
                <a class="mini-button mini-button-iconTop" iconcls="icon-edit" onclick="onClick" plain="true">设置</a> 
                <a class="mini-button mini-button-iconTop" iconcls="icon-close" onclick="onLoginOut" plain="true">登出</a>
            </div>
        </div>
        <div title="center" region="center" style="border: 0;" bodystyle="overflow:hidden;">
            <!--Splitter-->
            <div class="mini-splitter" style="width: 100%; height: 100%;" borderstyle="border:0;">
                <div size="170" maxsize="250" minsize="100" showcollapsebutton="true" style="border: 0;">
                    <!--OutlookTree-->
                    <div id="leftTree" class="mini-outlooktree" url="/methods/?method=itm.sys.usermenu.getcurrentusermenu" onnodeclick="onNodeSelect"
                        textfield="text" idfield="id" parentfield="pid">
                    </div>
                </div>
                <div showcollapsebutton="false" style="border: 0;">
                    <!--Tabs-->
                    <div id="mainTabs" class="mini-tabs" activeindex="0" style="width: 100%; height: 100%;">
                        <div title="首页" url="HomePage.aspx">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {

        });

        mini.parse();

        function showTab(node) {
            var tabs = mini.get("mainTabs");
            
            var id = "tab$" + node.id;
            var tab = tabs.getTab(id);
            if (!tab) {
                tab = {};
                tab.name = id;
                tab.title = node.text;
                tab.showCloseButton = true;

                //这里拼接了url，实际项目，应该从后台直接获得完整的url地址
                tab.url = node.url;

                tabs.addTab(tab);
            }
            tabs.activeTab(tab);
        }

        function onNodeSelect(e) {
            var node = e.node;
            var isLeaf = e.isLeaf;

            if (isLeaf) {
                showTab(node);
            }
        }

        function onLoginOut() {
            mini.confirm("确定是否登出 ？", "登出", function (action) {
                if (action == "ok") {
                    ygopAjaxClient.async("itm.sys.usermenu.loginout", "post", null, function (e) {
                        if (e.RspCode == 1) {
                            window.location.href = window.location.protocol + "\/\/" + window.location.host + "/Login.aspx";
                        }
                        else {
                            mini.alert(e.RspMsg);
                        }
                    });
                }
            });
        }

        function onClick(e) {
            var text = this.getText();
            alert(text);
        }
    </script>
</body>
</html>
